package com.dome.serice.asyncapi.impl;

import com.dome.serice.asyncapi.AsyncService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

/**
 * 描述：
 *
 * @author tangshunkai
 * @Date 2022/6/10 11:57
 */
@Slf4j
@Service
public class AsyncServiceImpl implements AsyncService {

//    @Async("customizeThreadPoolTask")
    @Override
    public void asyncTest() {
        try {
            Thread.sleep(5000);
            log.info("异步线程，{}"+Thread.currentThread().getName());
            log.info("添加延时看是否生效");
        }catch (Exception e){
            log.info(e.toString());
        }
        // 修改操作语句写这里
        log.info("这里执行异步任务");
    }
}
